using IM.Easy.Infrastructure.Query;
using System.ComponentModel.DataAnnotations;


namespace IM.Easy.SystemServices.Dtos.Department
{
    /// <summary>
    /// 组织和部门结构表查询实体
    /// </summary>
    public class SysDepartmentQueryDto : QueryBase
    {
        /// <summary>
        /// 部门名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public bool? IsActive { get; set; }

        /// <summary>
        /// 父级ID
        /// </summary>
        public long Pid { get; set; }

        /// <summary>
        /// 默认Sort排序
        /// </summary>
        public override string Sort { get; set; } = "Order";

        public override string SortType { get; set; } = "Asc";
    }

    /// <summary>
    /// 组织和部门结构表查询实体
    /// </summary>
    public class SysDepartmentTreeQueryDto
    {
        /// <summary>
        /// 部门名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 是否包含自己和后代节点
        /// </summary>
        public bool IncludeSelf { get; set; }

        /// <summary>
        /// 当前自己节点
        /// </summary>
        public long SelfId { get; set; }

        /// <summary>
        /// 根节点ID
        /// </summary>
        public long RootId { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public bool? IsActive { get; set; }

        public string SortType { get; set; } = "Desc";

        public string Sort { get; set; }
    }

    /// <summary>
    /// 组织和部门结构表dto
    /// </summary>
    public class SysDepartmentDto
    {
        /// <summary>
        /// 联系电话
        /// </summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 组织单位编号，用于唯一标识
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 组织单位类型 OrgTypeConstant 类型
        /// </summary>
        /// 
        public string Type { get; set; }
        /// <summary>
        /// 联系邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 组织单位名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 组织单位的唯一标识
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 描述信息
        /// </summary>
        public string Desc { get; set; }
        /// <summary>
        /// 上级组织单位ID，自引用用于组织和部门的层级关系
        /// </summary>
        public long ParentId { get; set; }
        /// <summary>
        /// 负责人ID（适用于部门经理或组织负责人）
        /// </summary>
        public long ManagerId { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        public bool IsActive { get; set; }
    }
}
